<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>登录君鉴仪器交易管理平台欢迎您!</title>
        <link rel="stylesheet" type="text/css" href="__CSS__/login.css" media="all">
		<!--[if lt IE 9]>
		<script type="text/javascript" src="__STATIC__/jquery1.min.js"></script>
		<![endif]-->
		<!--[if gte IE 9]><!-->
		<script type="text/javascript" src="__STATIC__/jquery2.min.js"></script>
		<!--<![endif]-->
		<script type="text/javascript" src="__STATIC__/layer/layer.min.js"></script>
		<script type="text/javascript" src="__STATIC__/Validform_v5.3.2.js"></script>
    </head>
    <body>
		<div class="top_box">
			<div class="logo_box"></div>
		</div>
        <div id="main-content">
			<div class="login_img"><img src="__CSS__/login/img.png"></div>
            <!-- 主体 -->
            <div class="login-body">
				<form action="{:U('login')}" method="post" class="login-form">
					<h3 class="welcome">用户登录</h3>
					<div id="itemBox" class="item-box">
						<div class="item">
							<i class="icon-login-user"></i>
							<input type="text" name="username" placeholder="请输入用户名" autocomplete="off"  datatype="*"  nullmsg="请输入用户名"/>
						</div>
						<span class="placeholder_copy placeholder_un">请输入用户名</span>
						<div class="item b0">
							<i class="icon-login-pwd"></i>
							<input type="password" name="password" placeholder="请输入密码" autocomplete="off"  datatype="*"  nullmsg="请输入密码"/>
						</div>
						<span class="placeholder_copy placeholder_pwd">请输入密码</span>
					</div>
					<div class="remember_box">
						<span class="ui-select"><input type="checkbox" id="rememberme" name="rememberme" checked></span>
						<label for="rememberme" id="rem_label">记住用户名</label>
						<a href="#" class="findpsw">忘记密码</a>
					</div>
					<div class="login_btn_panel">
						<button class="login-btn" type="submit"></button>
						<div class="no_account">没有帐号?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="">申请注册</a></div>
					</div>
				</form>
            </div>
        </div>
    <script type="text/javascript">
    	/* 登陆表单获取焦点变色 */
    	$(".login-form").on("focus", "input", function(){
            $(this).closest('.item').addClass('focus');
        }).on("blur","input",function(){
            $(this).closest('.item').removeClass('focus');
        });
		$(function(){
			//初始化选中用户名输入框
			$("#itemBox").find("input[name=username]").focus();
			$(".ui-select").click(function(){
				$(".ui-select").toggleClass('un-select');
			});
			
            //placeholder兼容性
                //如果支持 
            function isPlaceholer(){
                var input = document.createElement('input');
                return "placeholder" in input;
            }
                //如果不支持
            if(!isPlaceholer()){
				$("#rem_label").click(function(){
					$(".ui-select").toggleClass('un-select');
				});
                $(".placeholder_copy").css({
                    display:'block'
                })
                $("#itemBox input").keydown(function(){
                    $(this).parents(".item").next(".placeholder_copy").css({
                        display:'none'
                    })                    
                })
                $("#itemBox input").blur(function(){
                    if($(this).val()==""){
                        $(this).parents(".item").next(".placeholder_copy").css({
                            display:'block'
                        })                      
                    }
                })
            }
			var form = $(".login-form").Validform({
				tiptype:function(msg,o){
					if(!o.obj.is("form")){
						showmsg(msg);
					}
				},
				ajaxurl:{
					success:function(data,obj){
						if(data.status=='n')
						{
							obj.val('')
							obj.focus();
							return false;
						}
					}
				},
				ajaxPost:true,
				callback:function(data){
					if(data.status){
						window.location.href = data.url;
					} else {
						myAlert(data.info);
					}
				}
			});
		});
    </script>
</body>
</html>
